namespace org.jawk.intermediate
{
	/// <summary>Marks a position within the tuple list (queue).</summary>
	/// <remarks>Marks a position within the tuple list (queue).</remarks>
	public interface IPosition
	{
		/// <returns>
		/// true whether we are at the end
		/// of the tuple list, false otherwise
		/// </returns>
		bool IsEOF();

		/// <summary>
		/// Advances the position to the next tuple,
		/// as ordered within the tuple list (queue).
		/// </summary>
		/// <remarks>
		/// Advances the position to the next tuple,
		/// as ordered within the tuple list (queue).
		/// </remarks>
		void Next();

		/// <returns>
		/// the opcode for the tuple at this
		/// position
		/// </returns>
		int Opcode();

		/// <summary>
		/// Get the integer representation for a particular
		/// element within the tuple.
		/// </summary>
		/// <remarks>
		/// Get the integer representation for a particular
		/// element within the tuple.
		/// </remarks>
		/// <param name="idx">The item to retrieve from the tuple.</param>
		/// <returns>the integer representation of the item.</returns>
		int IntArg(int idx);

		/// <summary>
		/// Get the boolean representation for a particular
		/// element within the tuple.
		/// </summary>
		/// <remarks>
		/// Get the boolean representation for a particular
		/// element within the tuple.
		/// </remarks>
		/// <param name="idx">The item to retrieve from the tuple.</param>
		/// <returns>the boolean representation of the item.</returns>
		bool BoolArg(int idx);

		/// <summary>
		/// Get a reference to a particular element
		/// within the tuple.
		/// </summary>
		/// <remarks>
		/// Get a reference to a particular element
		/// within the tuple.
		/// </remarks>
		/// <param name="idx">The item to retrieve from the tuple.</param>
		/// <returns>a reference to the item.</returns>
		object Arg(int idx);

		/// <summary>Obtain the address argument for this tuple.</summary>
		/// <remarks>
		/// Obtain the address argument for this tuple.
		/// <p>
		/// This is a special form in that the tuple
		/// has only the address argument, and nothing else.
		/// </remarks>
		org.jawk.intermediate.IAddress AddressArg();

		/// <summary>Obtain the class argument for this tuple.</summary>
		/// <remarks>
		/// Obtain the class argument for this tuple.
		/// <p>
		/// This is a special form in that the tuple
		/// has only the class argument, and nothing else.
		/// </remarks>
		System.Type ClassArg();

		/// <summary>Get the source line number for this position.</summary>
		/// <remarks>Get the source line number for this position.</remarks>
		int LineNumber();
	}
}
